package com.unirio.pm.rules;

public class ScoreEvaluator {
	
	private int[] scoreRange;
	private String[] result;
	
	public ScoreEvaluator(int[] scoreRange, String[] result) {
		this.scoreRange = scoreRange;
		this.result = result;
	}
	
	public String evaluate(int score) {
		String evaluation = "";
    	for(int i=0; i<scoreRange.length; i++) {
    		if(score < scoreRange[i]) {
    			evaluation = result[i];
    			break;
    		}
    	}
    	if(evaluation.isEmpty()) {
    		int last = (result.length - 1);
    		evaluation = result[last];
    	}
    	return evaluation;
	}

}
